package com.hf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hf.entity.Track;
import com.hf.mapper.TrackMapper;
import com.hf.service.ITrackService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author eight
 * @since 2021-06-06
 */
@Service
public class TrackServiceImpl extends ServiceImpl<TrackMapper, Track> implements ITrackService {
	@Autowired
	TrackMapper trackMapper;

	@Override
	public IPage<Track> queryTracks(Integer page, Integer limit) {
		Page<Track> p = new Page<>(page, limit);
		QueryWrapper<Track> queryWrapper = new QueryWrapper<Track>();
		queryWrapper.orderByDesc("id");
		return trackMapper.selectPage(p, queryWrapper);
	}

	@Override
	public List<Track> getList(Integer cusId) {

		return trackMapper.getList(cusId);
	}

}
